home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 32 / Mac Magazin and MacEasy Magazine CD - Issue 32.iso / Grafik & Text / OzTeX3.0 / PS-files / geterrors.ps < prev    next >
Text File  |  1994-01-11  |  2KB  |  58 lines

  1. %!
  2. % This is a modified version of errhandler.ps.
  3. % It displays error messages in the OzTeX window
  4. % rather than printing them on paper.
  5.  
  6. /$brkpage where
  7. {pop (Error handler already loaded.\r) print flush stop}
  8. {(Downloading error handler.\r) print flush}ifelse
  9.  
  10. serverdict begin 0 exitserver
  11. /$brkpage 32 dict def
  12. $brkpage begin
  13. /prnt{dup type/stringtype ne{=string cvs}if print flush}bind def
  14. /nl{(\r) print flush}def
  15. /=={typeprint nl}def
  16. /typeprint{dup type dup currentdict exch known{exec}{unknowntype}ifelse}readonly def
  17. /tprint{prnt}readonly def
  18. /cvsprint{=string cvs tprint( )tprint}readonly def
  19. /unknowntype{exch pop cvlit(??)tprint cvsprint}readonly def
  20. /integertype{cvsprint}readonly def
  21. /realtype{cvsprint}readonly def
  22. /booleantype{cvsprint}readonly def
  23. /operatortype{(//)tprint cvsprint}readonly def
  24. /marktype{pop(-mark- )tprint}readonly def
  25. /dicttype{pop(-dictionary- )tprint}readonly def
  26. /nulltype{pop(-null- )tprint}readonly def
  27. /filetype{pop(-filestream- )tprint}readonly def
  28. /savetype{pop(-savelevel- )tprint}readonly def
  29. /fonttype{pop(-fontid- )tprint}readonly def
  30. /nametype{dup xcheck not{(/)tprint}if cvsprint}readonly def
  31. /stringtype
  32.  {dup rcheck{(\()tprint tprint(\))tprint}{pop(-string- )tprint}ifelse
  33.  }readonly def
  34. /arraytype
  35.  {dup rcheck{dup xcheck
  36.   {({)tprint{typeprint}forall(})tprint}
  37.   {([)tprint{typeprint}forall(])tprint}ifelse}{pop(-array- )tprint}ifelse
  38.  }readonly def
  39. /packedarraytype
  40.  {dup rcheck{dup xcheck
  41.   {({)tprint{typeprint}forall(})tprint}
  42.   {([)tprint{typeprint}forall(])tprint}ifelse}{pop(-packedarray- )tprint}ifelse
  43.  }readonly def
  44. /OLDhandleerror errordict /handleerror get def
  45. end % of $brkpage
  46.  
  47. errordict/handleerror
  48.  {systemdict begin $error begin $brkpage begin newerror
  49.    {/newerror false store
  50.     vmstatus pop pop 0 ne{grestoreall}if initgraphics
  51.     (POSTSCRIPT ERROR: )prnt errorname prnt nl
  52.     (OFFENDING COMMAND: )prnt/command load prnt nl
  53.     $error/ostack known
  54.     {nl (CONTENTS OF STACK:)prnt nl $error/ostack get aload length{==}repeat}if
  55.     /newerror true store/OLDhandleerror load end end end exec}{end end end}
  56.   ifelse}
  57. dup 0 systemdict put dup 4 $brkpage put bind readonly put
  58.